#!/usr/bin/env python3
# _*_coding:utf-8 _*_
__author__ = "Gao"
"""鼠标事件"""


import pygame
import sys

from pygame.locals import *
pygame.init()

screen = pygame.display.set_mode((600,500))

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            sys.exit()
        elif event.type == MOUSEMOTION:    # 鼠标移动事件
           # print('event.pos:',event.pos)    # 当前鼠标所在的坐标(x,y)
           # print('event.rel:',event.rel)    # 和上一个坐标比，移动的像素(x,y)
           # print()
            pass
        elif event.type == MOUSEBUTTONDOWN:    # 鼠标点击事件
            mouse_down = event.button    # 会取到相应数字
            print(event.pos)    # 获取到当前坐标

        elif event.type == MOUSEBUTTONUP:
            pass
    screen.fill((0, 80, 0))
    pygame.display.update()


